//
//  MWGoodsAttrCell.m
//  XiRan-iOS
//
//  Created by Richfit on 2019/12/26.
//  Copyright © 2019 Wood. All rights reserved.
//

#import "MWGoodsAttrCell.h"

@interface MWGoodsAttrCell ()

@property(nonatomic, strong) UILabel *attrNameLB;
@property(nonatomic, strong) UILabel *attrValueLB;

@end

@implementation MWGoodsAttrCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (!(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
        return nil;
    }
    
    [self setupPagesubviews];
    return self;
}

- (void)setAttrName:(NSString *)attrName {
    _attrNameLB.text = [NSString stringWithFormat:@"%@:", attrName];
}

- (void)setAttrValue:(NSString *)attrValue {
    _attrValueLB.text = attrValue;
}

- (void)setupPagesubviews {
    _attrNameLB = [[UILabel alloc] init];
    _attrNameLB.font = MWFont(12);
    _attrNameLB.textColor = MWHexColor(@"#666666");
    [self.contentView addSubview:_attrNameLB];
    
    _attrValueLB = [[UILabel alloc] init];
    _attrValueLB.font = MWFont(12);
    _attrValueLB.textColor = MWHexColor(@"#666666");
    [self.contentView addSubview:_attrValueLB];
    
    [_attrNameLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView);
        make.centerY.equalTo(self.contentView);
    }];
    
    [_attrValueLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.attrNameLB.mas_right).offset(5);
        make.centerY.equalTo(self.contentView);
    }];
    
}

@end
